package org.grayrabbit.cms.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name = "CMS_KEYWORDS_RECOMMEND")
public class KeywordsRecommend implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private String kwrecommendId;
	private Keywords keywords;
	private String recommendName;
	private String recommendurl;
	private Integer recommendtype;
	private String introduction;

	public KeywordsRecommend() {
	}

	public KeywordsRecommend(String kwrecommendId) {
		this.kwrecommendId = kwrecommendId;
	}

	public KeywordsRecommend(String kwrecommendId, Keywords keywords, String recommendurl, Integer recommendtype, String introduction) {
		this.kwrecommendId = kwrecommendId;
		this.keywords = keywords;
		this.recommendurl = recommendurl;
		this.recommendtype = recommendtype;
		this.introduction = introduction;
	}

	@Id
	@Column(name = "KWRECOMMEND_ID", unique = true, nullable = false, length = 32)
	@GeneratedValue(generator = "paymentableGenerator")       
	@GenericGenerator(name = "paymentableGenerator", strategy = "uuid") 
	public String getKwrecommendId() {
		return this.kwrecommendId;
	}

	public void setKwrecommendId(String kwrecommendId) {
		this.kwrecommendId = kwrecommendId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "KEYWORDS_ID")
	public Keywords getKeywords() {
		return this.keywords;
	}

	public void setKeywords(Keywords keywords) {
		this.keywords = keywords;
	}

	@Column(name = "RECOMMENDURL", length = 200)
	public String getRecommendurl() {
		return this.recommendurl;
	}

	public void setRecommendurl(String recommendurl) {
		this.recommendurl = recommendurl;
	}

	@Column(name = "RECOMMENDTYPE", precision = 1, scale = 0)
	public Integer getRecommendtype() {
		return this.recommendtype;
	}

	public void setRecommendtype(Integer recommendtype) {
		this.recommendtype = recommendtype;
	}

	@Column(name = "INTRODUCTION", length = 256)
	public String getIntroduction() {
		return this.introduction;
	}

	public void setIntroduction(String introduction) {
		this.introduction = introduction;
	}
	
	@Column(name = "RECOMMENDNAME", length = 50)
	public String getRecommendName() {
		return recommendName;
	}

	public void setRecommendName(String recommendName) {
		this.recommendName = recommendName;
	}

}
